﻿@*add by hz full page*@
@model BranchModel

<script type="text/javascript">
    $(function () {
        $("#@Html.FieldIdFor(model => model.CountryId)").change(function () {
             var selectedItem = $(this).val();
             var ddlStates = $("#@Html.FieldIdFor(model => model.StateProvinceId)")
                $.ajax({
                    cache: false,
                    type: "GET",
                    url: "@(Url.Action("GetStatesByCountryId", "Country"))",
                    data: "countryId=" + selectedItem + "&addEmptyStateIfRequired=true",
                    success: function (data) {
                        ddlStates.html('');
                        $.each(data, function (id, option) {
                            ddlStates.append($('<option></option>').val(option.id).html(option.name));
                        });
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        alert('Failed to retrieve states.')
                    }
                });
            });
     });
</script>
@Html.HiddenFor(model => model.Id)
@(Html.LocalizedEditor<BranchModel, BranchLocalizedModel>("branch-info-localized",
                @<table class="adminContent">
                    <tr>
                        <td class="adminTitle">
                            @Html.NopLabelFor(model => model.Locales[item].Name):
                        </td>
                        <td class="adminData">
                            @Html.EditorFor(model => Model.Locales[item].Name)
                            @Html.ValidationMessageFor(model => model.Locales[item].Name)
                        </td>
                    </tr>
                    <tr>
                        <td class="adminTitle">
                            @Html.NopLabelFor(model => model.Locales[item].City):
                        </td>
                        <td class="adminData">
                            @Html.EditorFor(model => model.Locales[item].City)
                            @Html.ValidationMessageFor(model => model.Locales[item].City)
                        </td>
                    </tr>
                     <tr>
                        <td class="adminTitle">
                            @Html.NopLabelFor(model => model.Locales[item].Address1):
                        </td>
                        <td class="adminData">
                            @Html.EditorFor(model => model.Locales[item].Address1)
                            @Html.ValidationMessageFor(model => model.Locales[item].Address1)
                        </td>
                    </tr>
                     <tr>
                        <td class="adminTitle">
                            @Html.NopLabelFor(model => model.Locales[item].Address2):
                        </td>
                        <td class="adminData">
                            @Html.EditorFor(model => model.Locales[item].Address2)
                            @Html.ValidationMessageFor(model => model.Locales[item].Address2)
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            @Html.HiddenFor(model => model.Locales[item].LanguageId)
                        </td>
                    </tr>
                </table>
                ,
                @<table>
                <tr>
                    <td class="adminTitle">
                        @Html.NopLabelFor(model => model.Name):
                    </td>
                    <td class="adminData">
                        @Html.EditorFor(model => model.Name)
                        @Html.ValidationMessageFor(model => model.Name)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.NopLabelFor(model => model.City):
                    </td>
                    <td class="adminData">
                        @Html.EditorFor(model => model.City)
                        @Html.ValidationMessageFor(model => model.City)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.NopLabelFor(model => model.Address1):
                    </td>
                    <td class="adminData">
                        @Html.EditorFor(model => model.Address1)
                        @Html.ValidationMessageFor(model => model.Address1)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.NopLabelFor(model => model.Address2):
                    </td>
                    <td class="adminData">
                        @Html.EditorFor(model => model.Address2)
                        @Html.ValidationMessageFor(model => model.Address2)
                    </td>
                </tr>
        </table>
        ))
<table>
<tr>
    <td class="adminTitle">
        @Html.NopLabelFor(model => model.DisplayOrder):
    </td>
    <td class="adminData">
        @Html.EditorFor(model => model.DisplayOrder)
        @Html.ValidationMessageFor(model => model.DisplayOrder)
    </td>
</tr>
<tr>
    <td class="adminTitle">
        @Html.NopLabelFor(model => model.Website):
    </td>
    <td class="adminData">
        @Html.EditorFor(model => model.Website)
        @Html.ValidationMessageFor(model => model.Website)
    </td>
</tr>
<tr>
    <td class="adminTitle">
        @Html.NopLabelFor(model => model.Email):
    </td>
    <td class="adminData">
        @Html.EditorFor(model => model.Email)
        @Html.ValidationMessageFor(model => model.Email)
    </td>
</tr>
<tr>
    <td class="adminTitle">
        @Html.NopLabelFor(model => model.CountryId):
    </td>
    <td class="adminData">
        @Html.DropDownListFor(model => model.CountryId, Model.AvailableCountries)
        @Html.ValidationMessageFor(model => model.CountryId)
    </td>
</tr>
<tr>
    <td class="adminTitle">
        @Html.NopLabelFor(model => model.StateProvinceId):
    </td>
    <td class="adminData">
        @Html.DropDownListFor(model => model.StateProvinceId, Model.AvailableStates)
        @Html.ValidationMessageFor(model => model.StateProvinceId)
    </td>
</tr>
<tr>
    <td class="adminTitle">
        @Html.NopLabelFor(model => model.ZipPostalCode):
    </td>
    <td class="adminData">
        @Html.EditorFor(model => model.ZipPostalCode)
        @Html.ValidationMessageFor(model => model.ZipPostalCode)
    </td>
</tr>
<tr>
    <td class="adminTitle">
        @Html.NopLabelFor(model => model.PhoneNumber):
    </td>
    <td class="adminData">
        @Html.EditorFor(model => model.PhoneNumber)
        @Html.ValidationMessageFor(model => model.PhoneNumber)
    </td>
</tr>
<tr>
    <td class="adminTitle">
        @Html.NopLabelFor(model => model.FaxNumber):
    </td>
    <td class="adminData">
        @Html.EditorFor(model => model.FaxNumber)
        @Html.ValidationMessageFor(model => model.FaxNumber)
    </td>
</tr>
</table>